using JwtBearerDemo.JwtHelper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace JwtBearerDemo.Controllers;


[Authorize]
[ApiController]
[Route("api/[controller]")]
public class HomeController : ControllerBase {
    /// <summary>
    /// 授权访问
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public IActionResult Index () {
        // 读取授权/账号信息
        var acc = this.Account();
        return Ok(acc);
    }
}